﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QueryData;

public class 查看生成的Sql语句
{
    void MyMethod()
    {
        using (var db = new BasicDbContext())
        {
            int id = 3;
            var sql = db.BasicEntities.Where(x => x.Id > id).ToQueryString();
            var cmd = db.BasicEntities.Where(x => x.Id > id).CreateDbCommand();
        }
    }
}
